<html>
<head><meta charset="utf-8"><title>impl-From-Arc-for-NonNull · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html">impl-From-Arc-for-NonNull</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="152199122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152199122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152199122">(Dec 19 2018 at 17:34)</a>:</h4>
<p>Hey.  So I'm trying to author a PR that implements <code>From&lt;Arc&lt;T&gt;&gt;</code> for <code>NonNull&lt;T&gt;</code> (and same for <code>Rc</code>).  But with Arc and Rc in liballoc, how do I implement libcore's NonNull?  Tried in both <code>src/libcore/ptr.rs</code> and <code>src/liballoc/arc.rs</code> but neither seems to work.  Any ideas?</p>



<a name="152201682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152201682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152201682">(Dec 19 2018 at 18:16)</a>:</h4>
<p>I'd guess you'd need some of the coherency extensions for that to work</p>



<a name="152211034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152211034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152211034">(Dec 19 2018 at 20:35)</a>:</h4>
<p>Tell me more <span class="emoji emoji-1f642" title="slight smile">:slight_smile:</span> What are those?  How do I get my hands on them?</p>



<a name="152211209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152211209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152211209">(Dec 19 2018 at 20:37)</a>:</h4>
<p>One example is <a href="https://github.com/rust-lang/rfcs/blob/master/text/2451-re-rebalancing-coherence.md" target="_blank" title="https://github.com/rust-lang/rfcs/blob/master/text/2451-re-rebalancing-coherence.md">RFC 2451</a></p>



<a name="152213241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152213241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152213241">(Dec 19 2018 at 21:07)</a>:</h4>
<p>That's just a proposal, though, isn't it?</p>



<a name="152213654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152213654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152213654">(Dec 19 2018 at 21:13)</a>:</h4>
<p>In terms of feedback loop, if I'm editing src/liballoc and writing tests in src/liballoc/tests, what's the optimal <code>./x.py test</code> command to run?  I wonder if I can keep stages if I'm just changing the std lib and so what the full command should be.</p>



<a name="152215554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152215554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152215554">(Dec 19 2018 at 21:45)</a>:</h4>
<p>I'd use <code>./x.py --stage 0 test src/liballoc --no-doc</code></p>



<a name="152215571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152215571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152215571">(Dec 19 2018 at 21:45)</a>:</h4>
<p>if you want to further only execute some tests, say for box, add <code>--test-args box</code></p>



<a name="152217073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152217073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152217073">(Dec 19 2018 at 22:10)</a>:</h4>
<p>thanks!</p>



<a name="152217156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152217156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152217156">(Dec 19 2018 at 22:12)</a>:</h4>
<p>Good to know I can use the stage 0 compiler.</p>



<a name="152225515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152225515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152225515">(Dec 20 2018 at 00:57)</a>:</h4>
<blockquote>
<p>That's just a proposal, though, isn't it?</p>
</blockquote>
<p>It's an accepted RFC which provides a link at the top to the <a href="https://github.com/rust-lang/rust/issues/55437" target="_blank" title="https://github.com/rust-lang/rust/issues/55437">Rust tracking issue</a> which itself mentions a <a href="https://github.com/rust-lang/rust/pull/56145" target="_blank" title="https://github.com/rust-lang/rust/pull/56145">PR implementing it</a>. I'd say more than a proposal.</p>



<a name="152225561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152225561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152225561">(Dec 20 2018 at 00:58)</a>:</h4>
<p>But if you wanted to use it today, you'd have to pull down that branch and compile it yourself</p>



<a name="152228736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152228736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152228736">(Dec 20 2018 at 02:17)</a>:</h4>
<p>Thanks.  I didn't see the backlink from the tracking issue.  But it not being merged means I can't yet use it for my PR to liballoc.</p>



<a name="152228742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152228742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152228742">(Dec 20 2018 at 02:17)</a>:</h4>
<p>Anyways I was able to implement Into instead of From, and submit the PR</p>



<a name="152262320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl-From-Arc-for-NonNull/near/152262320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl-From-Arc-for-NonNull.html#152262320">(Dec 20 2018 at 15:11)</a>:</h4>
<p><span class="user-mention" data-user-id="125311">@Dale Wijnand</span> I meant RFC 2451, i don't think they are implemented yet.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>